package DecoratorPattern;

import DecoratorPattern.Cirle.Circle;
import DecoratorPattern.Cirle.Rectangle;
import DecoratorPattern.Cirle.Shape;

/**
 * @Author: zhaojie
 * @Date: Created in 17:09 2018/6/26
 * @Description: 装饰者模式
 */
public class DecoratorPatternDemo {

    public static void main(String[] args) {
        Shape circl=new Circle();

        Shape redcircl=new RedShapeDecorator(new Circle());

        Shape redRectangle=new RedShapeDecorator(new Rectangle());
        System.out.println("Circle with normal border");
        circl.draw();

        System.out.println("\nCircle of red border");
        redcircl.draw();

        System.out.println("\nRectangle of red border");
        redRectangle.draw();
    }
}
